import Log4js from "log4js";
import dayjs from "dayjs";
import type { Logger } from "log4js";

const filename: string = `${dayjs().format("YYYYMM")}/${dayjs().format("DD")}-dailylog.log`;

Log4js.configure({
  appenders: { dailylog: { type: "file", filename: "../Log/" + filename } },
  categories: { default: { appenders: ["dailylog"], level: "trace" } },
});

const logger: Logger = Log4js.getLogger("dailylog")


export default logger